package com.walle.concurrenttest.pattern.threadpermessage;

/**
 * @author zhangjiapeng
 * @Package com.walle.concurrenttest.pattern.threadpermessage
 * @Description: ${todo}
 * @date 2019/2/21 14:20
 */
public class Helper {

    public void handle(int count,char c){
        System.out.println(" handle count <" + c + "> begin");
        String threadName = Thread.currentThread().getName();
        for (int i = 0; i < count; i++) {
            System.out.println(threadName + ":" + c);
            slowly();
        }
        System.out.println(" handle count <" + c + "> end");
    }

    private void slowly(){
        try {
            Thread.sleep(50);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
